package com.sse.serviceimpl.mod;

import org.springframework.stereotype.Service;

import com.sse.base.AbstractFinder;
import com.sse.common.PageView;
import com.sse.po.module.Module;
import com.sse.service.mod.ModServiceFinder;

@Service
public class ModServiceFinderImpl extends AbstractFinder<Module> implements
		ModServiceFinder {
	public PageView<Module> findPageByFlag(int mid, int pageNo, int pageSize) {
		if (mid == 0) {
			return super.findByPage(Module.class,
					"from Module m where m.parent=null", pageNo, pageSize);
		} else {
			return super.findByPage(Module.class,
					"from Module m where m.parent.m_id=" + mid, pageNo,
					pageSize);
		}
	}
}
